/* ***********************
 * Version: MPL 1.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is briefLicense.js module.
 *
 * The Initial Developer of the Original Code is Rob Gerns.
 *
 * Portions created by the Initial Developer are Copyright (C) 2011
 * the Initial Developer. All Rights Reserved.
 *
 **************************/
function getBriefLicense(objXmlDocument) {	
    /*************************************************
    * Function Name: getBriefLicense
    *
    * Purpose: Check to see if there is a license defined in the 
    * 'brief' section of the Oister feed.  If so, retrieve
    * the value.
    **************************************************/
    var objLicense = objXmlDocument.getElementsByTagName("license");
    var intLicenseCount = objLicense.length;
    var strLicense = "";

    if (intLicenseCount > 0) {
        strLicense = objLicense[0].firstChild.nodeValue;
    }
    if (strLicense !== "") {
        writeBriefLicense(strLicense);
    } 
}
function writeBriefLicense(strLicense) {
    /*************************************************
    * Function Name: writeBriefLicense
    *
    * Purpose: Write the appropriate HTML div layers
    * to display the license value.
    **************************************************/
    var objDivLicense = "";
    var objDivLicenseId = "";
    
    objDivLicense = document.createElement("div");
    objDivLicenseId = objDivLicense.id = "license";
    objDivLicense.className = "license";
    document.getElementById('begin').appendChild(objDivLicense);
    objDivLicense.innerHTML = "<pre>" + strLicense + "</pre>";   
}